<?php 
require '../../frame/base.php';
if(!isset( $_GET['cateId']) || !is_numeric( $_GET['cateId'])){
	echo json_encode(array('code'=>-200,'msg'=>'获取失败'));
	exit;
}

$page = 0;
$pagesize = 10;
if(isset($_GET['page'])){
	$page = (int)$_GET['page'];
}
if(isset($_GET['pagesize'])){
	$pagesize = (int)$_GET['pagesize'];
}

$page *= $pagesize;
$cateId = $_GET['cateId'];
$data = array();
if($page == 0){
	$hotResult = $Db->table('zifenlei')->field('fenleiid,name,pic,id')->where(array('fenleiid'=>$cateId,'isHot'=>1))->select();
	$data['hotFenlei'] = $hotResult;
}
$defaultResult = $Db->table('zifenlei')->field('fenleiid,name,pic,id')->where(array('fenleiid'=>$cateId,'isHot'=>0))->limit($page,$pagesize)->select();
$data['defaultFenlei'] = $defaultResult;
echo json_encode(array('code'=>200,'msg'=>'ok','data'=>$data));


 ?>